<div class="ui small remove modal transition" style="margin-top: -98px;">
<i class="close icon"></i>
<div class="header">
    删除仓库: {{ vm.selectedRepository.namespace }}/{{ vm.selectedRepository.repository }}
</div>
<div class="content">
    <p>你确认要删除此仓库?</p>
</div>
<div class="actions">
    <div class="ui negative button">
        不，取消
    </div>
    <div ng-click="vm.removeRepository()" class="ui positive right labeled icon button">
        是的，确认
        <i class="checkmark icon"></i>
    </div>
</div>
</div>

<div class="ui padded grid">
    <div class="two column row">
        <div class="left floated column">
            <div ng-click="vm.refresh()" class="ui small blue labeled icon button">
                <i class="refresh icon"></i> 刷新
            </div>
        </div>
    
        <div class="right aligned right floated column">
            <div class="ui small icon input">
                <input ng-model="tableFilter" placeholder="查询仓库信息..."/>
                <i class="search icon"></i>
            </div>
        </div>
    </div>
    
    <div class="row" ng-show="vm.repositories.length === 0">
        <div class="column">
            <div class="ui icon message">
                <i class="info icon"></i>
                <div class="content">
                    <div class="header">
                        仓库管理
                    </div>
                    <p>没有查询到任何仓库信息.</p>
                </div>
            </div>
        </div>
    </div>
    
    <div class="row" ng-hide="vm.repositories.length === 0">
    <div class="column">
    <table class="ui sortable celled table">
        <thead ng-hide="">
            <tr>
                <th>命名空间</th>
                <th>仓库中心</th>
                <th>标签</th>
                <th>层</th>
                <th>容量</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="r in vm.repositories | filter:tableFilter">
                <td>{{r.namespace}}</td>
                <td>{{r.repository}}</td>
                <td>{{r.tags.length}}</td>
                <td>{{r.layers.length}}</td>
                <td>{{r.size / 1048576 | number:2}} MB</td>
                <td class="collapsing">
                    <div ui-sref="dashboard.inspectRepository({name: vm.registryName, namespace: r.namespace, repository: r.repository})" class="compact ui icon button">
                        <i class="search icon"></i>
                    </div>
                    <div ng-click="vm.showRemoveRepositoryDialog(r)" class="compact ui icon button red">
                        <i class="trash icon"></i>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    </div>
    </div>
</div>

<script>
    $('.ui.sortable.celled.table').tablesort();
</script>
